import Vue from 'vue'
import VueRouter from 'vue-router'

import Manage from "../views/Manage";
import User from "../views/User";

// 使用路由
Vue.use(VueRouter)

export default new VueRouter({
  //去除页面上的 #
  mode: 'history', //加入这个页面路径从http://localhost:8080/home#/home变成http://localhost:8080/home


  routes: [
    {
      path: '/',
      name: 'Manage',
      component: Manage,
      redirect:"/home", //重定向到home 默认展示的页面
      children:[
        {path: '/home', name: '主页', component: ()=>import('../views/Home'),},
        {path: '/user', name: '用户信息', component: ()=>import('../views/User'),},
        {path: '/person', name: '个人信息', component: ()=>import('../views/Person'),},
        {path: '/file', name: '个人信息', component: ()=>import('../views/File'),},
      ]
    },
    {
      path: '/login',
      name: 'Login.vue',
      component: ()=>import('../views/Login'),
    },
    {
      path: '/Register',
      name: 'Register.vue',
      component: ()=>import('../views/Register'),
    },


  ]
})
